package com.ruoyi.mespro.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mespro.mapper.ShaftDefectDetailMapper;
import com.ruoyi.mespro.domain.ShaftDefectDetail;
import com.ruoyi.mespro.service.IShaftDefectDetailService;

/**
 * 疵点详情Service业务层处理
 * 
 * @author JunXiang
 * @date 2022-08-06
 */
@Service
public class ShaftDefectDetailServiceImpl implements IShaftDefectDetailService 
{
    @Autowired
    private ShaftDefectDetailMapper shaftDefectDetailMapper;

    /**
     * 查询疵点详情
     * 
     * @param id 疵点详情主键
     * @return 疵点详情
     */
    @Override
    public ShaftDefectDetail selectShaftDefectDetailById(Long id)
    {
        return shaftDefectDetailMapper.selectShaftDefectDetailById(id);
    }

    /**
     * 查询疵点详情列表
     * 
     * @param shaftDefectDetail 疵点详情
     * @return 疵点详情
     */
    @Override
    public List<ShaftDefectDetail> selectShaftDefectDetailList(ShaftDefectDetail shaftDefectDetail)
    {
        return shaftDefectDetailMapper.selectShaftDefectDetailList(shaftDefectDetail);
    }

    /**
     * 新增疵点详情
     * 
     * @param shaftDefectDetail 疵点详情
     * @return 结果
     */
    @Override
    public int insertShaftDefectDetail(ShaftDefectDetail shaftDefectDetail)
    {
        shaftDefectDetail.setCreateTime(DateUtils.getNowDate());
        return shaftDefectDetailMapper.insertShaftDefectDetail(shaftDefectDetail);
    }

    /**
     * 修改疵点详情
     * 
     * @param shaftDefectDetail 疵点详情
     * @return 结果
     */
    @Override
    public int updateShaftDefectDetail(ShaftDefectDetail shaftDefectDetail)
    {
        shaftDefectDetail.setUpdateTime(DateUtils.getNowDate());
        return shaftDefectDetailMapper.updateShaftDefectDetail(shaftDefectDetail);
    }

    /**
     * 批量删除疵点详情
     * 
     * @param ids 需要删除的疵点详情主键
     * @return 结果
     */
    @Override
    public int deleteShaftDefectDetailByIds(Long[] ids)
    {
        return shaftDefectDetailMapper.deleteShaftDefectDetailByIds(ids);
    }

    /**
     * 删除疵点详情信息
     * 
     * @param id 疵点详情主键
     * @return 结果
     */
    @Override
    public int deleteShaftDefectDetailById(Long id)
    {
        return shaftDefectDetailMapper.deleteShaftDefectDetailById(id);
    }
}
